﻿<?php
require_once("include/common.inc.php");
require_once("include/dedesql.class.php");

$title = '法治天下 - 院校搜索';
require_once('common/header.php');

$execSql = "";
$type = intval($_POST["type"]);
if($type == 0){
	echo "无效请求";exit;
}

//按学校地域查询
if($type == "1"){
	$weizhi = addslashes($_POST['weizhi']);
	$sql = "select * from object_city_title where val = '".$weizhi."'";
	$row = $dsql->GetOne($sql);
	$id = intval($row['id']);
	if($id > 0){
		$execSql = "select a.article_id, b.* from article_options_mapping a,cms_archives b where a.option_keyname = 'city_title' and a.option_value = '".$id."' and a.article_id = b.id and a.topicid in (88,89,90,91,92,93,94,95)";
	}
	$title = "按地理位置搜索'" . $_POST['weizhi'] . "'的院校";
}
//按院校类别查询
if($type == "2"){
	$leibie = addslashes($_POST['leibie']);
	$sql = "select * from object_school_type_title where val like '%".$leibie."%'";
	$row = $dsql->GetOne($sql);
	$id = intval($row['id']);
	if($id > 0){
		$execSql = "select a.article_id, b.* from article_options_mapping a,cms_archives b where a.option_keyname = 'school_type_title' and a.option_value = '".$id."' and a.article_id = b.id and a.topicid in (88,89,90,91,92,93,94,95)";
	}
	$title = "按院校类别搜索'" . $_POST['leibie'] . "'的院校";
}

//按院校专业查询
if($type == "3"){
	$zhuanye = addslashes($_POST['zhuanye']);
	$sql = "select * from object_school_specialized_title val like '%".$zhuanye."%'";
	$row = $dsql->GetOne($sql);
	$id = intval($row['id']);
	if($id > 0){
		$execSql = "select a.article_id, b.* from article_options_mapping a,cms_archives b where a.option_keyname = 'school_specialized_title' and a.option_value = '".$id."' and a.article_id = b.id and a.topicid in (88,89,90,91,92,93,94,95)";
	}
	$title = "按院校专业搜索'" . $_POST['leibie'] . "'的院校";
}

//按院校专业查询
if($type == "4"){
	$keyword = addslashes($_POST['keyword']);
	if(strlen(trim($keyword)) > 0){
		$execSql = "select * from cms_archives where title like '%".$keyword."%' or keywords like '%".$keyword."%' or description like '%".$keyword."%' and typeid in (88,89,90,91,92,93,94,95)";
	}
	$title = "按学校名称搜索'" . $_POST['leibie'] . "'的院校";
}

?>
<style>
.titbox {
height: 42px;
padding-top: 20px;
padding-left: 0px;
line-height: 29px;
font-size: 16px;
}
.pub_time {
color: #9C9C9C;
}
</style>

<div class="meun2 clearfix">
	<dl>
		<dd><a href="" class="school_a"><span>院校搜索</span></a></dd>
	</dl>
</div>
<div class="index_box clearfix">
	<div class="left_info">
<!--- 法治时评  start------>
		<div class="cn_box01" style="height:800px">
			<div class="titbox"><strong><?=$title?></strong></div>
			<ul class="one_row_box031">
				<li style="line-height: 24px;color: #0B3B8D;">
					<?php
						$dsql->SetQuery($execSql);
						$dsql->Execute();
						$i = 0;
						if($type == "4"){
							while($row = $dsql->GetArray())
							{
								echo "<a href=\"./info.php?id=".$row['id']."\" target=\"_blank\" style=\"width:480px\">".$row["title"]."</a><a class='date'>".date("Y-m-d", $row['senddate'])."</a>";
								$i++;
							}
						}else{
							while($row = $dsql->GetArray())
							{
								echo "<a href=\"./info.php?id=".$row['id']."\" target=\"_blank\" style=\"width:480px\">".$row["title"]."</a><a class='date'>".date("Y-m-d", $row['senddate'])."</a>";
								$i++;
							}
						}
						
						if($i == 0){
							echo "未搜索到相关文章.";
						}
					?>
				</li>
			</ul>
		</div>
<!--- end------>
		<div class="height_3"></div>
	</div>
	<div class="right_info">
		<?php
		require_once('common/right.php');
		?>
	</div>
</div>
<?php
require_once('common/footer.php');
?>